]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Cache cursor rectangle
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 17 Oct 2022 11:30:40 +0000 (13:30 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 26 Oct 2022 10:00:37 +0000 (10:00 +0000)
This may need to be synchronized in other places, so keep
the rectangle around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2512>

js/misc/inputMethod.js

index 3ee96a7fafe04bc7116e6fe9feaef079a5a98351..d9335cc81913aec7fa1049c83ead76871a82171e 100644 (file)
@@ -217,8 +217,13 @@ var InputMethod = GObject.registerClass({
 
     vfunc_set_cursor_location(rect) {
         if (this._context) {
-            this._context.set_cursor_location(rect.get_x(), rect.get_y(),
-                                              rect.get_width(), rect.get_height());
+            this._cursorRect = {
+                x: rect.get_x(), y: rect.get_y(),
+                width: rect.get_width(), height: rect.get_height(),
+            };
+            this._context.set_cursor_location(
+                this._cursorRect.x, this._cursorRect.y,
+                this._cursorRect.width, this._cursorRect.height);
             this._emitRequestSurrounding();
         }
     }